/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.autoescola.core.entity.questionary;

import com.autoescola.core.entity.Entitie;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author leonardo luz fernandes
 * @version 0.1
 * @since 01/11/2010
 */

@XmlRootElement(name="QuestionCategory")
@Entitie
@Entity
@Table(name="question_catetory")
public class QuestionCategory implements java.io.Serializable {

    private Long id;
    private Question question;
    private Category category;

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="id",unique=true,nullable=false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @ManyToOne(targetEntity=Category.class)
    @JoinColumn(name="category_id",referencedColumnName="id",nullable=false)
    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    @ManyToOne(targetEntity=Question.class)
    @JoinColumn(name="question_id",referencedColumnName="id",nullable=false)
    public Question getQuestion() {
        return question;
    }

    public void setQuestion(Question question) {
        this.question = question;
    }

}//end klazz
